From 2b1e273c53ffe0701df6876225d11297d0e9987f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 13 Feb 2020 13:56:33 +0000 Subject: [PATCH] ci: Use result instead of exit code in the JUnit report We have a result code coming from Meson which is more accurate than just looking at the exit code of the unit. --- .gitlab-ci/meson-junit-report.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/meson-junit-report.py b/.gitlab-ci/meson-junit-report.py index 248ef6e2b1..f63c82eb36 100755 --- a/.gitlab-ci/meson-junit-report.py +++ b/.gitlab-ci/meson-junit-report.py @@ -51,6 +51,7 @@ for line in args.infile: duration = data['duration'] return_code = data['returncode'] + result = data['result'] log = data['stdout'] unit = { @@ -58,6 +59,7 @@ for line in args.infile: 'name': unit_name, 'duration': duration, 'returncode': return_code, + 'result': result, 'stdout': log, } @@ -68,12 +70,12 @@ for name, units in suites.items(): print('Processing suite {} (units: {})'.format(name, len(units))) def if_failed(unit): - if unit['returncode'] != 0: + if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']: return True return False def if_succeded(unit): - if unit['returncode'] == 0: + if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']: return True return False -- 2.30.2